﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LTJ.Common;
using LTJ.Data;
using LTJ.Entity;
using LTJ.FrameWork;

namespace uswinweb.admin
{
    public partial class basedatatype_update : AdminPage
    {
        public BaseTypeInfo btInfo = new BaseTypeInfo();
        public string bcode = SASRequest.GetString("bid");
        protected void Page_Load(object sender, EventArgs e)
        {
            btInfo = BaseTypes.GetBaseTypeCode(bcode);
            if (SASRequest.IsPost())
            {
                UpdateBaseType();
            }
        }
        protected void UpdateBaseType()
        {
            string etname = SASRequest.GetString("etnametxt").Trim();
            string tname = SASRequest.GetString("tnametxt").Trim();
            string expo = "";
            LTJ.Entity.BType bt = new LTJ.Entity.BType();
            int i = 1;
            foreach (LTJ.Entity.BType btt in Enum.GetValues(bt.GetType()))
            {
                if (SASRequest.GetString("expo" + i) != "")
                {
                    expo += SASRequest.GetString("expo" + i) + ",";
                }
                i++;
            }
            BaseTypes.UpdateBaseType(bcode, tname, etname, expo.Trim(','));
            base.RegisterStartupScript("PAGE", "parent.document.getElementById('reclick').click();parent.Lightview.hide();");
        }
    }
}